<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>标题</title>
	<meta name="keywords" content="" />
	<meta name="description" content="" />
	<link rel="stylesheet" href="style.css" />
	<script src='http://js.selfimg.com.cn/jquery/jquery-1.7.1.min.js'></script> 

</head>
<body>
	
	<h2>变量</h2>
	<div id="content">
					
	</div>
	<script id="tmpl" type="text/html">
		Hello {{name}} {{age}}
	</script>

	<div id="content2">
					
	</div>
	<script id="tmpl2" type="text/html">
		Hello {{{name}}}
	</script>

	<h2>循环</h2>
	<div id="content3">
					
	</div>
	<script id="tmpl3" type="text/html">
		{{#repo}}
		  <b>{{name}}</b>
		{{/repo}}
		{{^repo}}
		  No repos :(
		{{/repo}}
	</script>

	<script src="hogan-2.0.0.js"></script>
	<script>
		var tmpl = Hogan.compile($("#tmpl").html());
		$("#content").html( tmpl.render({name: "<b>jianjun.wang</b>"}) );

		var tmpl2 = Hogan.compile($("#tmpl2").html());
		$("#content2").html( tmpl2.render({name: "<b>jianjun.wang</b>"}) );

		var repo = {
			  "repo": [
			    { "name": "resque" },
			    { "name": "hub" },
			    { "name": "rip" }
			  ]
			}
		var tmpl3 = Hogan.compile($("#tmpl3").html());
		$("#content3").html( tmpl3.render( repo ) );
	</script>
</body>
</html>